package com.cch.demo.sys.mapper;

import com.cch.demo.sys.domain.Role;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 华哥
 * @since 2020-03-08
 */
public interface RoleMapper extends BaseMapper<Role> {

    public void removeRolePermissionByRid(@Param("id") Serializable id);

    public void removeRoleUserByRid(@Param("id") Serializable id);

    /**
     * 根据rid查询所有的pid
     * @param rid
     * @return
     */
    public List<Integer> queryRolePermissionByRid(@Param("rid") Integer rid);

    public void saveRolePermission(@Param("rid") Integer rid,@Param("pid") Integer id);

    /**
     * 根据用户ID删除sys_role_user里面的数据
     * @param id
     */
    public void reoveRoleUserByUserId(@Param("uid") Serializable id);


    List<Integer> queryRoleUserByUid(@Param("uid") Integer id);


    void saveRoleUser(@Param("uid") Integer uid,@Param("rid") Integer rid);

    /**
     * 通过用户ID删除sys_role_user
     * @param uid
     */
    void removeRoleUserByUid(@Param("uid") Integer uid);
}
